import axios from 'axios'
const urlBase = process.env.VUE_APP_BASE_URL || "http://119.23.127.239:3333/phm-web-service-gz/"
// post
export function postAction(url, parameter) {
  return axios({
    baseURL: urlBase,
    url: url,
    method: 'post',
    data: parameter
  })
}

// post method= {post | put}
export function httpAction(url, parameter, method) {
  return axios({
    baseURL: urlBase,
    url: url,
    method: method,
    data: parameter
  })
}

// put
export function putAction(url, parameter) {
  return axios({
    baseURL: urlBase,
    url: url,
    method: 'put',
    data: parameter
  })
}

// get
export function getAction(url, parameter) {
  return axios({
    baseURL: urlBase,
    url: url,
    method: 'get',
    params: parameter
  })
}

// deleteAction
export function deleteAction(url, parameter) {
  return axios({
    baseURL: urlBase,
    url: url,
    method: 'delete',
    params: parameter
  })
}